package day07demo;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println();
        System.out.println("请输入机票价格");
        double price = sc.nextDouble();
        System.out.println("请输入月份");
        int month = sc.nextInt();
        System.out.println("请输入舱位");
        int choose = sc.nextInt();
        getPrice(price,month,choose);

    }

    public static void getPrice(double price, int month,int choose){
        int changePrice = 0;
        if (5 <= month &&  month < 10){
            switch (choose){
                case 1-> {changePrice =(int) (price *.9);
                    System.out.println("商务舱的价格为" + (price *.9));}
                case 2-> {changePrice =(int) (price *.9);
                    System.out.println("普通舱的价格为" + (price *.85));}
                case 3-> {changePrice =(int) (price *.9);
                    System.out.println("经济舱的价格为" + (price *.65));}
                default -> System.out.println("没有该舱位");
            }
        }else if ( month <= 12){
            switch (choose){
                case 1-> {changePrice =(int) (price *.9);
                    System.out.println("商务舱的价格为" + (price *.8));}
                case 2-> {changePrice =(int) (price *.9);
                    System.out.println("普通舱的价格为" + (price *.75));}
                case 3-> {changePrice =(int) (price *.9);
                    System.out.println("经济舱的价格为" + (price *.55));}
                default -> System.out.println("没有该舱位");

            }
        }else {
            System.out.println("月份错误");
        }
       // return changePrice;
    }
}
